// thread_create.c
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>

typedef struct {
    int age;
    char name[20];
} Student;

void* create(void* arg) {
    Student* stu = (Student*)arg;
    printf("Student age: %d\n", stu->age);
    printf("Student name: %s\n", stu->name);
    return NULL;
}

int main() {
    pthread_t tid;
    Student stu = {20, "abcdefg"};
    if (pthread_create(&tid, NULL, create, (void*)&stu) != 0) {
        perror("pthread_create failed");
        return -1;
    }
    pthread_join(tid, NULL);
    return 0;
}
